const Actions = require('./actions');
import { Toast } from 'saltui';
const DB = require('app/db.js');
module.exports = Reflux.createStore({
    listenables: [Actions],
    data: {
        listData:[]
    },

    onFetch: function (params, cb) {
        let t = this;
        DB.Notice.get_notice_member({
            schoolId: params.schoolId,
            noticeId: params.noticeId
        })
            .then((content) => {
                if (content.code == '1') {
                     this.data.listData = content.data.dataList;
                    this.updateComponent();
                }

            })
            .catch(function (error) {
                Toast.show({
                    type: 'error',
                    content: '系统异常'
                });
            });
    },

    updateComponent: function () {
        this.trigger(this.data);
    }
});
